<?php
//рус
include_once(_APP_PATH. "business/users/users_mapper.php");
class users_admin_http extends controller_prototype_class
{
    private $_usersMapper;
    private $_imageMapper;	

    protected function GetMapper()
    {
		if (!$this->_usersMapper) $this->_usersMapper = UsersMapper::GetInstance($this->User()); 
		return $this->_usersMapper;     	
    }
    
    protected function GetGroupsMapper()
    {
    	include_once(_APP_PATH. "business/groups/groups_mapper.php");
		return GroupsMapper::GetInstance($this->User());     	
    }    
    
    protected function GetImageMapper()
    {
		if (!$this->_imageMapper) 
		{
			include_once(_APP_PATH. "business/image/image_mapper.php");
			$this->_imageMapper = ImageMapper::GetInstance(); 
		}
		return $this->_imageMapper;     	
    }     
    
    public function GetSmallLoginForm()
    {
		$t = $this->GetTemplator();
		return $t->render('users/_login_status.phtml');    	
    }    
    
    public function GetPhotoThumbFolder($thumbFolder)
    {
        return $this->GetImageMapper()->GetImageThumbFolder($thumbFolder, MozgCfg::GetProp('global/users//avatarImageFolder'));      
    }  

    public function GetUsersByName($name, $maxRecords = 50, $isExactSearch = false)
    {
    	return $this->GetMapper()->GetUsersByName($name, $maxRecords, $isExactSearch);
    }
}